package com.zhangtai.modules.service.leave;

import com.zhangtai.modules.entity.leave.ShiftEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


/**
 * 调班申请表
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-12-08 09:58:40
 */

public interface ShiftService {

    @GetMapping("/findShiftList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "shiftName", required = false) String shiftName,
                         @RequestParam(value = "shiftOid", required = false) String shiftOid,
                         @RequestParam(value = "orgIds", required = false) List<Long> orgIds,
                         @RequestParam(value = "shiftOrgName", required = false) String shiftOrgName,
                         @RequestParam(value = "shiftUnitName", required = false) String shiftUnitName,
                         @RequestParam(value = "shiftJobName", required = false) String shiftJobName,
                         @RequestParam(value = "shiftDateStart", required = false) String shiftDateStart,
                         @RequestParam(value = "shiftDateEnd", required = false) String shiftDateEnd,
                         @RequestParam(value = "frequency", required = false) List<Integer> frequency,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    @GetMapping("/infoShift")
    @ApiOperation(value = "根据id查找")
    ShiftEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/saveShift")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody ShiftEntity entity);

    @PostMapping("/updateShift")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody ShiftEntity entity);

    @GetMapping("/deleteOneShift")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteShifts")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

